<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>思途CMS{$coreVersion}</title>
    {template 'stourtravel/public/public_min_js'}
    {php echo Common::getCss('style.css,base.css,base_new.css'); }
    {php echo Common::getScript("jquery.validate.js,jquery.validate.addcheck.js"); }
    <style>
        .info-item-block{
            padding: 0;
        }
        .info-item-block>li .item-hd{
            width: 60px;
        }
        .info-item-block>li .item-bd{
            padding-left: 65px;
        }
    </style>
</head>
<body style="width: 320px; height: 243px; overflow: hidden">

<form id="frm" name="frm">
    <ul class="info-item-block">
        <li class="list_dl">
            <span class="item-hd">手机号：</span>
            <div class="item-bd">
                <span class="select-box">
                    <select name="level_id" class="select">
                        <option value="0">请选择等级</option>
                        {loop $level_list $v}
                        <option value="{$v['id']}">{$v['name']}</option>
                        {/loop}
                    </select>
                </span>
            </div>
        </li>
        <li class="list_dl">
            <span class="item-hd">有效期：</span>
            <div class="item-bd">
                <label class="radio-label mr-10"><input type="radio" name="grade_expire_time" checked value="0">永久有效</label>
                <label class="radio-label mr-10"><input type="radio" name="grade_expire_time" value="1">有效期<input type="text" name="day" class="input-text w80" onkeyup="this.value=this.value.replace(/\D/g,'')">天</label>

            </div>
        </li>
    </ul>
    <div class="clearfix mt-15 text-c">
        <a class="btn btn-primary radius" id="btn_save" href="javascript:;">保存</a>
        <input type="hidden" id="mid" name="mid" value="{$mid}">
    </div>
</form>

<script language="JavaScript">
    var action='{$action}';

    $(function(){
        //保存
        $("#btn_save").click(function(){
            var level_id = $("select[name='level_id']").find('option:selected').val();
            if(level_id<1){
                ST.Util.showMsg('请选择等级','5',1000);
                return;
            }
            var grade_expire_time = $("input[name='grade_expire_time']:checked").val();
            var day = $("input[name='day']").val();
            if(grade_expire_time==1 && !day){
                ST.Util.showMsg('请填写有效天数','5',1000);
                return;
            }

            ST.Util.responseDialog({level_id:level_id,day:day,grade_expire_time:grade_expire_time},true);
        })
    })
</script>

</body>
</html>